package com.fqh.manager.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.fqh.commons.base.Constants;
import com.fqh.manager.entity.TSysUser;
import com.fqh.manager.service.TSysUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

/**
* @author fqh 
* @version 创建时间：2017年11月29日 下午3:13:17
* 类说明
*/
@Controller
@RequestMapping("/sysuser")
public class TSysUserController {
	
	@Autowired 
	TSysUserService userService;
	@RequestMapping("/list")
	public String list(Model model,@RequestParam(required=false,defaultValue="1")int pageNO) {
	    int size=Constants.PAGE_SIZE; 
		PageHelper.startPage(pageNO, size);
	    List<TSysUser> user = userService.selectAll();
	    model.addAttribute("user", user);
	    PageInfo<TSysUser> page = new PageInfo<TSysUser>(user);
	    model.addAttribute("page", page);
		return "sysuser/list";
	}
}
